<?xml version='1.0' encoding='UTF-8' ?>
<!--
    Document   : master-client
    Created on : Jun 8, 2011, 11:56:25 AM
    Author     : iTrustSolution <hari(dot)christian(at)gmail(dot)com>
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/templates/page.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:define name="title">RISK CAUSE</ui:define>

    <ui:define name="content">
        <h:form id="form">
            <ice:panelGroup>
                <ice:panelGrid columns="2" columnClasses="labelColumn,fieldColumn">
                    <ice:outputText value="RISK CAUSE ID" rendered="false"/>
                    <ice:inputText label="RISK CAUSE ID" binding="#{riskCauseBean.inpTxtId}" rendered="false"/>
                    <ice:outputText value="RISK CAUSE TYPE" />
                    <ice:selectOneMenu binding="#{riskCauseBean.somCauseType}"
                                       value="#{riskCauseBean.selectedCauseType}" disabled="true">
                        <f:selectItems value="#{riskCauseBean.causeTypes}"/>
                    </ice:selectOneMenu>
                    <ice:outputText value="RISK CAUSE DESC " />
                    <ice:inputText label="RISK CAUSE DESC" binding="#{riskCauseBean.inpTxtDesc}" disabled="true"/>
                    <ice:outputText value="TICKET" />
                    <ice:selectOneMenu binding="#{riskCauseBean.somTicket}"
                                       value="#{riskCauseBean.selectedTicket}" disabled="true">
                        <f:selectItems value="#{riskCauseBean.tickets}"/>
                    </ice:selectOneMenu>
                    
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </ice:panelGrid>
                <ice:panelGroup>
                    <ice:commandButton value="Add" binding="#{riskCauseBean.cmdBtnAdd}"
                                       action="#{riskCauseBean.add}" />
                    <ice:commandButton value="Edit" binding="#{riskCauseBean.cmdBtnEdit}"
                                       action="#{riskCauseBean.edit}"/>
                    <ice:commandButton value="Save" binding="#{riskCauseBean.cmdBtnSave}"
                                       action="#{riskCauseBean.save}" visible="false"/>
                    <ice:commandButton value="Delete" binding="#{riskCauseBean.cmdBtnDelete}"
                                       action="#{clientBean.delete}"/>
                    <ice:commandButton value="Cancel" binding="#{riskCauseBean.cmdBtnCancel}"
                                       action="#{riskCauseBean.cancel}" visible="false"/>
                </ice:panelGroup>  
            </ice:panelGroup>

            <!-- DataTable with RowSelector Component -->
            <ice:panelGroup styleClass="exampleBox " >
                <ice:dataTable id="dt"
                               var="item"
                               value="#{riskCauseBean.dataTables}"
                               rows="10" 
                               columnClasses="tableCol" >
                    <ice:column>
                        <ice:rowSelector id="selected" selectionListener="#{riskCauseBean.rowSelectionListener}"/>
                        <f:facet name="header"><ice:outputText value="ID"/></f:facet>
                        <ice:outputText id="Number" value="#{item.riskCauseId}"/>
                    </ice:column>

                    <ice:column>
                        <f:facet name="header"><ice:outputText value="CAUSE TYPE"/></f:facet>
                        <ice:outputText value="#{item.rskRiskCauseType.riskCauseTypeName}"/>
                    </ice:column>

                    <ice:column>
                        <f:facet name="header"><ice:outputText value="DESC"/></f:facet>
                        <ice:outputText value="#{item.riskCauseDesc}"/>
                    </ice:column>

                    <ice:column>
                        <f:facet name="header"><ice:outputText value="TICKET"/></f:facet>
                        <ice:outputText value="#{item.tckTicket.ticketCode}"/>
                    </ice:column>
                </ice:dataTable>
            </ice:panelGroup>
            
            <ice:panelGroup style="float:left;width:420px;">
                <center>
                    <ice:dataPaginator id="dataScroll"
                                       for="dt"
                                       fastStep="5"
                                       paginator="true"
                                       paginatorMaxPages="10">
                        <f:facet name="first">
                            <ice:graphicImage id="firstpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-first.gif"
                                              style="border:none;"
                                              title="First Page"/>
                        </f:facet>
                        <f:facet name="last">
                            <ice:graphicImage id="lastpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-last.gif"
                                              style="border:none;"
                                              title="Last Page"/>
                        </f:facet>
                        <f:facet name="previous">
                            <ice:graphicImage id="previouspage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-previous.gif"
                                              style="border:none;"
                                              title="Previous Page"/>
                        </f:facet>
                        <f:facet name="next">
                            <ice:graphicImage id="nextpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-next.gif"
                                              style="border:none;"
                                              title="Next Page"/>
                        </f:facet>
                        <f:facet name="fastforward">
                            <ice:graphicImage id="fastforward_1"
                                              url="/assets/styles/icefusion/css-images/arrow-ff.gif"
                                              style="border:none;"
                                              title="Fast Forward"/>
                        </f:facet>
                        <f:facet name="fastrewind">
                            <ice:graphicImage id="fastrewind_1"
                                              url="/assets/styles/icefusion/css-images/arrow-fr.gif"
                                              style="border:none;"
                                              title="Fast Backward"/>
                        </f:facet>
                    </ice:dataPaginator>
                </center>
            </ice:panelGroup>
        </h:form>
    </ui:define>
</ui:composition>